﻿<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>订单管理</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <!--responsive-->
    <link rel="shortcut icon" href="../Content/img/jridge.ico" />
    <link rel="bookmark" href="../Content/img/jridge.ico" />
    <script src="../Scripts/jquery-1.10.2.min.js"></script>
    <script src="../Scripts/clipboard-polyfill.js"></script>
    <!--公共样式-->
    <link rel="stylesheet" href="./content/index.css">
    <!--vue-->
    <script src="../Scripts/vue-2.5.9/vue.min.js"></script>
    <!--axios-->
    <script src="../Scripts/vue-2.5.9/axios.min.js"></script>
    <!--elementUI-->
    <script src="./Scripts/elementUI-2.4.0/index.js"></script>
    <link rel="stylesheet" href="./Scripts/elementUI-2.4.0/theme-chalk/index.css">
    <!-- 导出Excel -->
    <script src="../Scripts/table-export/xlsx.core.min.js"></script>
    <script src="../Scripts/table-export/FileSaver.js"></script>
    <script src="../Scripts/table-export/tableexport.min.js"></script>
    <link href="../Scripts/table-export/tableexport.min.css" rel="stylesheet" />
    <!--custom-->
    <link rel="stylesheet" href="../Content/vue-common.css">
    <script src="./Scripts/vue-service-school.js"></script>
    <script src="../Scripts/service/vue-service.js"></script>
    <style>
        .el-table {
            font-size: 12px
        }

        .el-form-item {
            margin-bottom: 22px !important;
        }

        .el-tree-node__content {
            height: 20px;
            margin: 5px 0px;

        }

        .el-tree-node__expand-icon.expanded {
            padding: 0px;
            margin-right: 20px;
            width: 15px;
            height: 15px;
            content: url("./img/icon/PlmProductClassification.png");
        }

        .el-tree-node__expand-icon.expanded {
            transform: rotate(0deg);
            /*不让旋转*/
        }

        .el-tree-node__expand-icon.is-leaf {
            padding: 0px;
            margin-right: 20px;
            width: 15px;
            height: 15px;
            content: url("./img/icon/PlmProductClassProduct.png");
        }

        .el-tree-node__expand-icon.is-leaf {
            transform: rotate(0deg);
            /*不让旋转*/
        }
    </style>
</head>

<body id="body">
    <div id="app">
        <header-bar :pagename="pagename" :userinfo="userinfo"></header-bar>
        <el-row>
            <el-col :span="3">
                <side-bar></side-bar>
            </el-col>
            <el-col :span="21">
                <div id="container">
                    <div id="content">
                        <el-row>
                            <el-col :span="3">
                                <el-radio-group v-model="filter" @change="getData()" size="small">
                                    <el-radio-button label="未发布"></el-radio-button>
                                    <el-radio-button label="已发布"></el-radio-button>
                                </el-radio-group>
                            </el-col>
                            <el-col :span="3" :offset="1">
                                <el-button type="primary" @click="addorder" size="small">
                                    <i class="el-icon-tickets" style="padding-right:10px"></i>新增</el-button>
                                <el-button type="primary" icon="el-icon-refresh" size="small" @click="getData()"></el-button>
                            </el-col>
                            <el-col :span="8" v-show="searchType">
                                <el-col :span="13">
                                    <el-input v-model="search.orderno" clearable size="small" placeholder="订单号..."></el-input>
                                </el-col>
                                <el-col :span="10" :offset="1">
                                    <el-button type="primary" icon="el-icon-search" size="small" @click="getData()">搜索</el-button>
                                </el-col>
                            </el-col>
                            <el-col :span="7">
                                <div style="float: right">
                                    <el-pagination background @current-change="handleCurrentChange" :current-page="currentpage" :page-size="everypagenum" layout="total, prev, pager, next "
                                        :total="totalnum">
                                    </el-pagination>
                                </div>
                            </el-col>
                        </el-row>
                        <el-row style="margin-top:15px;">
                            <el-table :data="currentData" style="width: 100%" border v-loading="loading" :max-height="mainTable_maxHeight" :height="mainTable_maxHeight"
                                @row-dblclick="look">
                                <el-table-column fixed type="index" label="序号" width="50" align="center">
                                </el-table-column>
                                <el-table-column v-for="list in head" :prop="list.property" :label="list.name" :filters="list.filters" :filter-method="filterHandler"
                                    sortable align="center">
                                </el-table-column>

                                <el-table-column fixed="right" label="操作" width="150" class="operate" v-if="filter=='未发布'" align="center">
                                    <template slot-scope="scope">
                                        <el-button @click="edit(scope.row)" type="text" size="small">编辑</el-button>
                                        <el-button @click="delDialog(scope.$index,data)" type="text" size="small">删除</el-button>
                                        <el-button @click="cancel(scope.$index,data)" type="danger" size="small" v-if="scope.row.properties.state == 2">取消发布</el-button>
                                        <!-- <el-button @click="startFlow(scope.$index,data)" type="warning" size="small" v-if="scope.row.properties.state == 0">启动流程</el-button> -->
                                    </template>
                                </el-table-column>
                            </el-table>
                        </el-row>
                    </div>

                </div>
            </el-col>
        </el-row>

        <!--订单删除对话框-->

        <el-dialog title="提示" :visible.sync="deleteOrderDialog" width="30%">
            <span>是否确定删除？</span>
            <span slot="footer" class="dialog-footer">
                <el-button type="danger" @click="del()">确 定</el-button>
                <el-button @click="deleteOrderDialog = false">取 消</el-button>
            </span>
        </el-dialog>

        <!--新增订单填写弹出框-->
        <el-dialog title="新增订单" :visible.sync="addDialog" id="addDialog" class='md_dialog_700 md_dialog_min_700' :close-on-click-modal="false"
            :close-on-press-escape="false">
            <el-form :model="addCurrent" ref="addCurrent" :rules="addCurrentRules">
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="订单号" :label-width="formLabelWidth" prop="orderno">
                            <el-input v-model="addCurrent.orderno" auto-complete="off"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="订单名称" :label-width="formLabelWidth" prop="name">
                            <el-input v-model="addCurrent.name" auto-complete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="产品名称" :label-width="formLabelWidth" prop="name">
                            <el-input v-model="addCurrent.productName" auto-complete="off" v-on:focus="clickToSelProduct()"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="订单数量" :label-width="formLabelWidth" prop="orderquantity">
                            <el-input v-model.number="addCurrent.orderquantity" auto-complete="off"></el-input>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="12">
                        <el-form-item label="客户名称" :label-width="formLabelWidth" prop="customer">
                            <el-input v-model="addCurrent.customer" auto-complete="off"></el-input>
                        </el-form-item>
                    </el-col>
                    <el-col :span="12">
                        <el-form-item label="交付时间" :label-width="formLabelWidth" prop="deliverydate">
                            <el-date-picker style="width: 100%" v-model="addCurrent.deliverydate" type="date" placeholder="选择日期">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="addDialog = false">取 消</el-button>
                <el-button type="primary" @click="saveOrder('addCurrent')" v-loading.fullscreen.lock="fullscreenLoading">确 定</el-button>
            </div>
        </el-dialog>

        <!--产品树-->
        <el-dialog title="请选择所需加工的产品" :visible.sync="productTreeDialog">
            <el-card>
                <el-tree :data="productTree" :props="defaultProps" @node-click="handleProductNodeClick"></el-tree>
            </el-card>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="confirmProductSelected()">确 定</el-button>
                <el-button @click="productTreeDialog = false">取 消</el-button>
            </div>
        </el-dialog>

        <!-- 详细信息以及产品组成查看弹出框 -->
        <el-dialog title="订单详细信息" :visible.sync="detailmsgDialog" class='md_dialog_700 md_dialog_min_700'>
            <!--详细信息-->
            <el-row>
                <el-form :model="orderChecked" v-if="orderChecked" label-width="200px">

                    <el-form-item label="产品名称">
                        <span>{{orderChecked.properties.name}}</span>
                    </el-form-item>

                    <el-form-item label="交付时间">
                        <span>{{orderChecked.properties.deliverydate}}</span>
                    </el-form-item>
                </el-form>

            </el-row>

        </el-dialog>
        <!--人员选择器组件-->
        <component :is="currentComponent" :obj="currentComponentObj" :userinfo="userinfo"></component>

    </div>
    <script>
        $('#body').css('height', $(window).height());
        $('#container').css('height', $(window).height() - 80);
    </script>
    <script src="addorder.js"></script>
    <script src="./Template/vue-components.js"></script>
</body>

</html>